package org.dna.metronomo.persistence;

import java.io.Serializable;
import java.util.List;

public class User implements Serializable {
	private static final long serialVersionUID = 1524542032535911008L;
	protected int id;
	private String name;
	private String password;
	private String role;
	private List<Job> jobs;
	@SuppressWarnings("unused")
	private StatusEnum status = StatusEnum.VALID;

	public User() {
	}

	public User(String name, String password, String role) {
		this.name = name;
		this.password = password;
		this.role = role;
	}

    public int getId() {
		return id;
	}

	public List<Job> getJobs() {
		return jobs;
	}

	public String getName() {
		return name;
	}

	public String getPassword() {
		return password;
	}
	
	public void setPassword(String pwd) {
		this.password = pwd;
	}

	/**
	 * Bleah used by the UI
	 * */
	public void setRole(String role) {
		this.role = role;
	}

	public String getRole() {
		return role;
	}

    @Override
    public String toString() {
        return String.format("id=%d name=%s role=%s", id, name, role);
    }
}
